package com.courseSchedulingSystem.config;

import com.courseSchedulingSystem.interceptors.AdminJwtInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class AdminInterceptorConfig implements WebMvcConfigurer{
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AdminJwtInterceptor())
                .addPathPatterns("/api/admin/**") //其他接口token验证
                .excludePathPatterns("/api/admin/login/**");//登录接口放行
    }
}
